package com.mio.web.service.recommend;

import java.util.List;

import org.durcframework.core.expression.ExpressionQuery;
import org.durcframework.core.expression.subexpression.ValueExpression;
import org.durcframework.core.service.CrudService;
import org.springframework.stereotype.Service;

import com.mio.web.common.MioConstants;
import com.mio.web.dao.recommend.RecommandDao;
import com.mio.web.entity.recommend.Recommand;

@Service
public class RecommandService extends CrudService<Recommand, RecommandDao> {

	public List<Recommand> listIndexRecommend() {
		ExpressionQuery query = new ExpressionQuery();
		query.addValueExpression(new ValueExpression("isDeleted", MioConstants.DELETED_FALSE));
		query.setLimit(3);
		query.setFirstResult(0);
		query.addSort("sortId", "asc");
		query.addSort("id", "desc");
		return this.getDao().find(query);
	}

}